<?php
/**
 * exports Oscommerce Artikel to differet Marektplaces (Amazon Seller; Google...)
 *
 * @category   export
 * @package    export
 * @author     Andreas Koch <andreaskoch1@googlemail.com>
 * @copyright  2011-2012; Andreas Koch; www.netzwerkplatz.de
 * @version    CVS: $Id:
 */


require_once 'include/config.inc.php';
require_once 'lib/validate/ISPN.php';
require_once('Mail.php');

/**
*get arguments to detect Export Libary
*/
$usage = "Usage: $argv[0] [amazon|google|yatego]\n";
if($argc<2){
        echo $usage;
        exit(1);
}
if (($argv[1]) == "amazon") {
        echo "export to amazon\n";
        include 'export_libs/amazon.php';
} elseif (($argv[1]) == "google") {
        echo "export to google\n";
        include 'export_libs/google.php';
} elseif (($argv[1]) == "yatego") {
        echo "yatego is not yet implemented\n";
        exit(2);
} else {
        echo $usage;
        exit(1);
}


function convertToWindowsCharset($string) {
  $charset =  mb_detect_encoding(
    $string,
    "UTF-8, ISO-8859-1, ISO-8859-15",
    true
  );

  $string =  mb_convert_encoding($string, "Windows-1252", $charset);
  return $string;
}

function trimall($str, $charlist = "\t\n")
{
  return str_replace(str_split($charlist), '', $str);
}

?>